package r5.powtorka6;

public class Szef extends Pracownik {

	private int bonus;

	public Szef(String imie, int pensja) {
		super(imie, pensja);
		this.bonus = 0;
	}

	public int getBonus() {
		return this.bonus;
	}

	public void setBonus(int bonus) {
		this.bonus = bonus;
	}

	@Override
	public int getPensja() {
		return super.getPensja() + this.bonus;
	}

	@Override
	public String toString() {
		return toString() + ", bonus " + formatujWaluta(this.bonus);
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + bonus;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		Szef other = (Szef) obj;
		if (bonus != other.bonus)
			return false;
		return true;
	}
}
